package com.qk.manangement.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qk.entity.pojo.Activity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * @Entity com.qk.entity.pojo.Activity
 */
public interface ActivityMapper extends BaseMapper<Activity> {

    /**
     * 条件查询
     * @param channel  渠道来源
     * @param type  活动类型
     *
     * @return  分页结果
     */
    List<Activity> PageList(Integer channel, Integer type, Integer status);

    /**
     * 删除根据id
     * @param id
     * @return
     */
    @Delete("delete from activity where id = #{id}")
    int delete(Integer id);

    /**
     * 添加
     * @param activity
     * @return
     */
    int add(Activity activity);

    /**
     * 根据id查询
     * @param id
     * @return
     */
    @Select("select * from activity where id = #{id}")
    Activity getById(Integer id);

    /**
     * 修改
     * @param activity
     * @return
     */
    int update(Activity activity);
}




